package com.zzty.txj1.dao;

import com.zzty.txj1.entity.Ability;
import com.zzty.txj1.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface AbilityDao {
    @Select("select * from ability where id=#{id}")
    Ability getAbilityById(Ability ability);

    @Select("select userId from ability")
    List<Integer> getAllUserId();

    @Update("update ability set performAbility=#{performAbility},credibility=#{credibility} where userId=#{userId}")
    void updateAbility(Ability ability);

    @Insert("insert into ability (userId,performAbility,credibility,talkAbility,studyAbility,laziness) values (#{id},100.0,100.0,100.0,100.0,0.0)")
    Integer addAbility(User user);

    @Select("select * from ability where userId=#{id}")
    Ability getAbilityByUserId(User user);
}
